#include "IntroScene.h"
#include "ChatMessageLayer.h"

using namespace cocos2d;

CCScene* IntroScene::scene() {
	CCScene* scene = NULL;
	scene = CCScene::node();

	CCLayer *layer = IntroScene::node();
	scene->addChild(layer);

	return scene;
}

void IntroScene::onEnterTransitionDidFinish() {
		this->scheduleOnce(schedule_selector(IntroScene::introChatBox), .5);
}

bool IntroScene::init() {
	CCSprite* _introBackground = CCSprite::spriteWithFile("Images\\Intro Screen\\intro_background.png");
	CCSprite* _introPokemon = CCSprite::spriteWithFile("Images\\Intro Screen\\intro_pokemon.png");
	CCSprite* _introPokeball = CCSprite::spriteWithFile("Images\\Intro Screen\\intro_pokeball.png");

	_introBackground->setPositionX(400);
	_introBackground->setPositionY(300);

	_introPokemon->setPositionX(362);
	_introPokemon->setPositionY(282);

	_introPokeball->setPositionX(372);
	_introPokeball->setPositionY(317);

	this->addChild(_introBackground);

	//this->addChild(_introPokemon);
	//this->addChild(_introPokeball);

	//this->addChild(ChatMessageLayer::node());

	return true;
}

void IntroScene::menuCloseCallBack(CCObject* pSender) {
	CCDirector::sharedDirector()->end();
}

void IntroScene::introChatBox(ccTime c) {
	ChatMessageLayer *temp = ChatMessageLayer::node();

	temp->AddPage("Hello shitface!")
		->AddPage("How the fuck are yah?")
		->AddPage("Im doin pretty fukin good.")
		->AddPage("Fuck off....")
		->AddPage("Faggot ash...");

	temp->OnNextPageCallback = new CustomEvent(this, callfuncO_selector(IntroScene::testFunction));

	this->addChild(temp);
}